package com.gullmall.product.web;

import com.gullmall.product.entity.CategoryEntity;
import com.gullmall.product.service.CategoryService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;


@Controller
public class IndexController {

    @Resource(name = "categoryService")
    private CategoryService categoryService;

    @GetMapping({"/","index.html"})
    public String indexPage(){
        //获取1级分类
//        List<CategoryEntity> topLevelCategory=
//                categoryService.getTopLevelCategory();
//        List<CategoryEntity> categoryEntities = categoryService.listWithTree();
//        model.addAttribute("categoryEntities",categoryEntities);
        return "index";
    }
}
